/*
 * @Author       : Thyssen Wen
 * @Date         : 2022-09-22 13:13:01
 * @LastEditors  : Thyssen Wen
 * @LastEditTime : 2022-09-23 03:32:56
 * @Description  : IDCardFactory Class
 * @FilePath     : /cdesign-pattern/Factory/IDCardFactory.h
 */
#pragma once
#include <vector>
#include <string>
#include "Factory.h"
#include "Product.h"
#include "IDCard.h"

namespace idcard{
    class IDCardFactory;
}

class idcard::IDCardFactory: public framework::Factory
{
private:
    std::vector<std::string> owners;
public:
    IDCardFactory(/* args */);
    ~IDCardFactory();
    framework::Product* createProduct(std::string owner){
        return new IDCard(owner);
    }
    std::vector<std::string>* getOwner(){
        return &owners;
    }
protected:
    void registerProduct(framework::Product* product){
        owners.push_back(((idcard::IDCard*)product)->getOwner());
    }
};

idcard::IDCardFactory::IDCardFactory(/* args */)
{
}

idcard::IDCardFactory::~IDCardFactory()
{
}
